<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<f:subview id="home">

	<ui:composition template="/WEB-INF/layout/template.xhtml">
		<ui:define name="conteudo">

			<br />
			<h:panelGrid columns="1">

				<h:form id="login">
					<br />
					<p:commandButton value="Usuario Online" onclick="dlg1.show();"
						type="button" />
					<p:dialog header="Usuario" widgetVar="dlg1">
						<div align="center">
							<h:outputText value="#{loginBean.login}" />
							<br />
							<h:commandButton value="logout" action="#{loginBean.logout}" />
						</div>
					</p:dialog>
				</h:form>
			</h:panelGrid>
			<br />
			<h:panelGrid columns="4">
				<h:form id="menu">
					<h:column>
						<h:commandButton value="Cadastrar Aluno" action="cadastrarAluno"
							style=" height : 50px;"></h:commandButton>
					</h:column>
					<h:column>
						<h:commandButton value="Cadastrar Professor"
							action="cadastrarProfessor" style=" height : 50px;"></h:commandButton>
					</h:column>
					<h:column>
						<h:commandButton value="Cadastrar de Aula" rendered="#{not loginBean.indAluno}"
							action="cadastroAula" style=" height : 50px;"></h:commandButton>
					</h:column>
					<h:column>
						<h:commandButton value="Relatório"
							action="relatorio" style=" height : 50px;"></h:commandButton>
					</h:column>
				</h:form>
			</h:panelGrid>


			<h:form id="aulas">
				<p:dataTable var="aula" value="#{aulaBean.aulas}">
					<p:column>
						<f:facet name="header">  
                    Data  
            			</f:facet>
						<h:outputText value="#{aula.data}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    Conteudo 
            			</f:facet>
						<h:outputText value="#{aula.conteudo}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    Disciplina  
          			  </f:facet>
						<h:outputText value="#{aula.disciplinas.nome}" />
					</p:column>


				</p:dataTable>
			</h:form>


		</ui:define>
	</ui:composition>
</f:subview>
</html>